<?php

class Payment extends BasePayment
{
  
  public function getListName(){
    return $this->getAccountCustomer()->getContact()->getListName();
  }
  
  public function getPaymentDate(){
    return $this->getDocument()->getDocumentDate();
  }
  
  public function getPaymentId(){
    return $this->getPaymentType().'-'.$this->getPaymentNumber();
  }
  
  public function getCheckTotal(){
    $paymentCheckss = $this->getPaymentCheckss();
    $total = 0;
    foreach($paymentCheckss as $paymentChecks)
      $total += $paymentChecks->getCheckAmount();
    return $total;
  }
  
  public function getInvoiceTotal(){
    $paymentInvoices = $this->getPaymentInvoices();
    $invoice_total=0;
    foreach($paymentInvoices as $paymentInvoice)
      $invoice_total+=$paymentInvoice->getAmount();
    return $invoice_total;
  }
  
  public function getTotalPayment(){
    return $this->getCash()+$this->getCheckTotal();
  }

}
